package com.ele.client.rpc;

import com.ele.shared.AuthException;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;

public abstract class SimpleAsyncCallback<T> implements AsyncCallback<T> {
    @Override
    public void onFailure(Throwable caught) {
        if (caught instanceof AuthException) {
            History.newItem("LoginPlace:");
        } else {
            Window.alert("Information! \n" + caught.getMessage());
            GWT.log("Exception", caught);
        }
    }
}
